<template>
	<view>
		<view class="tn-main-gradient-indigo--reverse kaiti admin-title">友情链接</view>
		<view class="link">
			<tn-list-cell
				v-for="item in linkList"
				:key="item.id"
				:fontColor="item.color"
				:arrow="true"
				@click="openPge(item.href)"
				:arrowRight="true">
				{{item.name }}
			</tn-list-cell>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				linkList:[]
			};
		},
		methods:{
			getLink(){
				this.$api.getLink().then(res => {
					console.log(res)
					if(res.code == 200){
						this.linkList = res.data
					}
				})
			},
			openPge(url){
				uni.navigateTo({
				    url:`/pages/webView/index?herf=${url}`
				})
			}
		},
		onShow() {
			this.getLink()
		}
	}
</script>

<style lang="scss">
.admin-title{
	text-align: center;
	font-size: 38rpx;
	padding: 20rpx 0;
}
.link{
	padding: 40rpx;
}
</style>
